<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>textContent与innerText</title>
</head>
<body>
    <!-- <div id="app">
        <h1>houdunren.com</h1>
    </div> -->


    <div id="app">
        <div class="houdunren" data="hd">houdunren.com</div>
        <div class="hdcms">hdcms.com</div>
    </div>

    <script>
        // let app = document.querySelector(`#app`);
        // console.log(app.textContent);
        // //设置的时候将标签当做文本来对待，转化为html实体内容,不会对html标签进行解析
        // app.textContent = "<h1>后盾人</h1>";
        // console.log(app.innerText);//只会获取内容   清空 空白文本



        //outerText
        // let h1 = document.querySelector(`h1`);
        // h1.outerText = '后盾人';
        // console.log(h1.outerText);


        //inserrAjdacentText
        
        // let app = document.querySelector(`#app`);
        // let span = document.createElement('span');
        // app.insertAdjacentText('beforebegin','<h1>后盾人</h1>');





    </script>
</body>
</html>
